package com.lfs.market.controller.payment;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.lfs.market.model.R;
import com.lfs.market.service.PaymentPayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/payment/pay")
@SaCheckLogin
public class PaymentPayController {

    @Autowired
    PaymentPayService paymentPayService;

//    @PostMapping
//    public R createPaymentPay(@RequestBody PaymentPayDto dto) {
//        String id = paymentPayService.createPaymentPay(dto.getPaymentOrderId());
//        return R.ok(id);
//    }

    @PutMapping("/finish/{OrderNo}")
    public R finishPay(@PathVariable("OrderNo") String OrderNo) {
        paymentPayService.finishPay(OrderNo);
        return R.ok();
    }
}
